<#include "portlet-layout.ftl"/>
<@layout>
                    <div  ng-controller="PublicTodoCtrl" >
                      <table class="table table-striped table-hover table-condensed ng-cloak" style="width: 100%">
                        <col width="24"/>
                        <tbody>
                          <tr ng-repeat="todo in todoList">
                            <td><span id="todo_{{todo.todo.id}}">
                              <span ng-if="-2==todo.todo.status" class="badge badge-warning"><@s.message code="todo.status.-2" /></span>
                              <span ng-if="-1==todo.todo.status" class="badge badge-inverse"><s:message code="todo.status.-1" /></span>
                              <span ng-if="1==todo.todo.status" class="badge badge-info"><s:message code="todo.status.1" /></span>
                              <span ng-if="2==todo.todo.status" class="badge badge-important"><s:message code="todo.status.2" /></span>
                              <span ng-if="3==todo.todo.status" class="badge badge-success"><s:message code="todo.status.3" /></span>&nbsp;
                              {{todo.todo.content}}</span>
                              <span class="pull-right">{{todo.userInfo.userName}}<small class="grey">[{{todo.todo.todoDatetime | date: 'yy-MM-dd'}}]</small></span>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                      <div class="more-div" ng-click="showMore();"><span><@s.message code="btn.more" /></span> <i class="icon-chevron-down icon-large"></i></div>
                    </div>
<script type="text/javascript">
function PublicTodoCtrl($scope, $http, $filter) {
	  $scope.todoList = [];
	  var pageIndex = 2;
	        
	  $http.post("${contextPath}/personal/todo/getTenantPublic.json").success(function(data) {
	    var todoList = data.todoList;          
	    $scope.todoList = todoList;
	  });
};
</script>                    
</@layout>